package com.deram.ctin.serv.business.impl;

import com.deram.ctin.common.bean.PageResult;
import com.deram.ctin.serv.business.api.BusinessCourtApi;
import com.deram.ctin.serv.business.entity.BaseUpdateInfo;
import com.deram.ctin.serv.business.entity.BusinessCourt;
import com.deram.ctin.serv.business.filter.BusinessCourtFilter;
import com.deram.ctin.serv.business.service.BusinessCourtService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: jtt
 * @Description:
 * @Date: 2017/9/13 15:56
 * @version: V1.0
 */
@RestController
public class BusinessCourtApiImpl implements BusinessCourtApi {

    @Autowired
    BusinessCourtService businessCourtService;

    @Override
    public List<BusinessCourt> list(@RequestBody BusinessCourtFilter param) {
        return businessCourtService.list(param);
    }

    @Override
    public BusinessCourt save(@RequestBody BusinessCourt param) {
        return businessCourtService.save(param);
    }

    @Override
    public PageResult<BusinessCourt> search(@RequestBody BusinessCourtFilter filter, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize) {
        return businessCourtService.search(filter, pageNo, pageSize);
    }

    @Override
    public void delete(Long id) {
        businessCourtService.delete(id);
    }

    @Override
    public void saveList(@RequestBody BaseUpdateInfo<BusinessCourt> updateInfo) {
        businessCourtService.saveList(updateInfo);
    }
}
